﻿namespace MSSqlSchemaDoc.Core.DataStructures
{
    using System;
    using System.Collections.ObjectModel;
    using System.Xml.Serialization;

    /// <summary>
    /// Provides minimal information about a trigger (just gives an overview).
    /// Fields like the trigger definition is specifically excluded.
    /// </summary>
    [Serializable()]
    public class TableTrigger : DataStructureObjectBase
    {
        /// <summary>
        /// Gets or sets the events that cause a trigger to fire.
        /// </summary>
        [XmlArray()]
        public Collection<TriggerEvent> Events { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the trigger fires "INSTEAD OF" the normal operation, or "AFTER" the operation.
        /// </summary>
        [XmlElement()]
        public bool IsInsteadOf { get; set; }
    }
}
